﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;

namespace CodeCamp.Model
{
    //[Table("cc_UsersInRoles")]
    public class UserInRole
    {
        public UserInRole()
        {
            CreatedUTC = DateTime.UtcNow;
        }

        [Key]
        //[ForeignKey("Role")]
        //[Column(Order = 0)]
        public int RoleId { get; set; }

        [Required]
        public virtual Role Role { get; set; }

        [Key]
        //[ForeignKey("SiteUser")]
        //[Column(Order = 0)]
        public int SiteUserId { get; set; }

        [Required]
        public virtual SiteUser SiteUser { get; set; }

        [Required]
        public DateTime CreatedUTC { get; protected set; }

        [Required]
        [MaxLength(128)]
        public string CreatedBy { get; set; }
    }
}
